Skip to content

feat(extraction): exclude FM-Agent's work directory by default - #7

Merged
Dshuishui merged 1 commit into
mainfrom
fork/ignore-fm-agent-workdir
Aug 11, 2026
Merged

feat(extraction): exclude FM-Agent's work directory by default#7
Dshuishui merged 1 commit into
mainfrom
fork/ignore-fm-agent-workdir

Conversation

@Dshuishui

Copy link
Copy Markdown
Collaborator

FM-Agent writes fm_agent/ into the project it analyses — one copy of every
extracted function, plus the scripts staged to produce them — so indexing it
lists each function twice and mixes tool code in with project code. On a
four-function Python project that is 43 of 47 function nodes.

Adds fm_agent to DEFAULT_IGNORE_DIRS, and bumps the version to
1.5.0-fmagent.2.

Why this is fork-only

Upstream's list is curated from the github/gitignore templates, and the comment
above it says names that could plausibly be first-party source are deliberately
left out. fm_agent is such a name, so it stays here rather than going upstream.
A project that does own an fm_agent/ directory opts back in with a .gitignore
negation, exactly as for vendor/ or any other default-ignored directory.

Why not codegraph.json

The supported way to express this is an exclude entry in the project's
codegraph.json, and FM-Agent does exactly that today. It works — but it means
FM-Agent creates a file in a repository it does not own, on every project it
analyses, purely to describe its own artifacts.

Carrying the exclusion in the build FM-Agent already pins removes that: nothing
gets written outside FM-Agent's own work directory. The codegraph.json write
stays for now, since a build that is not this fork has no other mechanism — it can
be dropped once the pinned build is guaranteed to be the one running.

Verification

A project holding fm_agent/, with neither codegraph.json nor .gitignore:

build nodes
current release 79
this branch 6 (only src/app.py)
this branch + !fm_agent/ in .gitignore 79

npm run build passes; npm test is 2901 passed, 0 failed — unchanged from the
base. codegraph-benchmark passes 4/4 against this build (one regression case,
three baseline cases).

FORK.md

The fork carried no code patch until now, so the file said so. It now lists this
one in a table with a note that each patch must be re-applied on every upstream
sync
— that list is what catches a merge silently dropping one.

It also records the real pinned base: upstream main at c6aaa20, which is past
v1.5.0, and why the version marker still reads 1.5.0-fmagent.N. The policy
paragraph is brought in line with what the last sync actually did — merging an
untagged upstream commit is allowed when what we need is unreleased, with the
verification burden on us.

FM-Agent writes fm_agent/ into the project it analyses. It holds one copy of
every function extracted from that project plus the scripts staged to produce
them, so indexing it lists each function twice and mixes tool code in with
project code - on a four-function Python project, 43 of 47 function nodes.

Add `fm_agent` to DEFAULT_IGNORE_DIRS. Unlike the entries around it this name is
not from the github/gitignore templates and could plausibly be real source, which
is why upstream would not carry it; a project that does own an fm_agent/
directory opts back in with a `.gitignore` negation, as for any other
default-ignored directory.

The supported way to express this is an `exclude` entry in the project's
codegraph.json, which is what FM-Agent does today. It works, but it means
FM-Agent creates a file in a repository it does not own, on every project it
analyses, purely to describe its own artifacts. Carrying the exclusion in the
build it already pins removes that: nothing is written outside FM-Agent's own
work directory. The codegraph.json write stays until the pinned fork build is
guaranteed to be the one running, since an upstream build has no other mechanism.

Measured on a project holding fm_agent/ with neither codegraph.json nor
.gitignore: 79 nodes before, 6 after - and 79 again with `!fm_agent/` in
.gitignore.

FORK.md now records the patch in a table, states that each one must be re-applied
on every upstream sync, and names the real pinned base (upstream main c6aaa20,
which is past v1.5.0) alongside why the version marker still reads
1.5.0-fmagent.N. The policy paragraph is brought in line with what the last sync
actually did: merging an untagged upstream commit is allowed when what we need is
unreleased, and then the verification burden is ours.

Version bumped to 1.5.0-fmagent.2.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Dshuishui
Dshuishui merged commit f110d26 into main Aug 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant